package com.stan.core.mapper;

import com.stan.core.vo.Top10Category;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Top10Category的Mapper
 */
@Mapper
public interface Top10CategoryMapper {
    // 进入批量插入
    @Insert({
            "<script>insert into t_top10_category (task_id,category_id,click_count,order_count,defray_count) values " +
                    "<foreach collection='top10Categories' item='category' index='index' separator=','>" +
                    "(#{category.taskId},#{category.categoryId},#{category.clickCount},#{category.orderCount},#{category.defrayCount})" +
                    "</foreach>" +
                    "</script>"
    })
    void insertList(@Param("top10Categories") List<Top10Category> top10Categories);
}
